/**
 * 
 */
package ru.opedge.notifical.util.transliteration;

/**
 * @author opedge
 * 
 */
public abstract class Transliterator
{
	private static TransliteratorRegistry registry = new TransliteratorRegistry();

	public static Transliterator getInstance(final String id)
	{
		return registry.getTransliterator(id);
	}

	public abstract String getReplace(char c);

	public String transliterate(final String input)
	{
		final char[] charArray = input.toCharArray();
		final StringBuilder builder = new StringBuilder();
		for (final char c : charArray)
			builder.append(getReplace(c));
		return builder.toString();
	}

}
